﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PEC.Forms
{
    public partial class FrmConfiguration : Form
    {
        public FrmConfiguration()
        {
            InitializeComponent();
            txbXuongId.Text = Util.ConfigTools.Get("XuongId");
            ndfLineCount.Value = PecController.Current.SoChuyen;// Convert.ToInt32(Util.ConfigTools.Get("SoChuyen"));
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Util.ConfigTools.Change("XuongId", txbXuongId.Text);
            Util.ConfigTools.Change("SoChuyen", ndfLineCount.Value.ToString());
            PecController.Current.XuongId = txbXuongId.Text;
            PecController.Current.SoChuyen = Convert.ToInt32(ndfLineCount.Value);
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
    }
}
